<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<html>
<head>
<title>Insert title here</title>
<script type="text/javascript" src="/lookdom/js/jquery-1.8.0.js" charset="UTF-8"></script>
</head>
<body>
<input type="button" onclick="goIndex();" value="인덱스페이지"> <br><br>
	<table border="1">
		<tr>
			<td>사업코드</td>
			<td>
				<input type="text" id="bizcd" size="10">
			</td>
		</tr>
		<tr>
			<td>그룹코드</td>
			<td>
				<input type="text" id="groupcd" size="10">
			</td>
		</tr>
		<tr>
			<td>사업명</td>
			<td>
				<input type="text" id="bizname" size="10">
			</td>
		</tr>
		<tr>
			<td>사업내용</td>
			<td>
				<input type="text" id="bizcont" size="10">
			</td>
		</tr>
		<tr>
			<td>등록일자</td>
			<td>
				<input type="text" id="stdate" size="10">
			</td>
		</tr>
		<tr>
			<td>수정일자</td>
			<td>
				<input type="text" id="modate" size="10">
			</td>
		</tr>
		<tr>
			<td colspan="2">
				<input type="button" value="저장" onclick="goBiz();">
			</td>
		</tr>
		<tr>
			<td>
				<input type="button" value="상세입력">
			</td>
			<td>
				<input type="button" value="업무 리스트 확인" onclick="goBizList();">
			</td>
		</tr>
	</table>
</body>

<script type="text/javascript">

	function goBiz() {
		var bizcd = $("#bizcd").val();
		var groupcd = $("#groupcd").val();
		var bizname = $("#bizname").val();
		var bizcont = $("#bizcont").val();
		var stdate = $("#stdate").val();
		var modate = $("#modate").val();
		
		var url = "goBiz.do?" + "bizcd=" + bizcd
									+ "&groupcd=" + groupcd
									+ "&bizname=" + bizname
									+ "&bizcont=" + bizcont
									+ "&stdate=" + stdate
									+ "&modate=" + modate;
		$.ajax({
			type	: "POST",
			url		: url,
			//dataType: "json",
			data	: "",
			success	: function() {
						console.log("성공");		
				 //alert("성공");
				// var url = "/lookdom/userList.do";    
				// $(location).attr('href',url);
			} ,
	         error: function(xhr, status, error) {
	        	 alert('error-'+error); 
	         }
		});
	}
	
	function goBizList() {
		var url = "/lookdom/bizList.do";
		$(location).attr('href',url);
	}

	function goIndex() {
		var url = "/lookdom/index.do";
		$(location).attr('href',url); 
	}
</script>

</html>